package cl.uchile.sketchpad.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cl.uchile.sketchpad.persistance.dao.SlideDao;
import cl.uchile.sketchpad.persistance.model.Slide;

@Service
public class SlideServiceImpl implements SlideService {
	
	@Autowired
	private SlideDao slideDao;

	@Override
	@Transactional(readOnly = true)
	public List<Slide> getAll() {
		return slideDao.getAll();
	}

	@Override
	@Transactional(readOnly = true)
	public Slide findById(Integer id) {
		return slideDao.findById(id);
	}

	@Override
	@Transactional
	public void persist(Slide slide) {
		this.slideDao.persist(slide);
	}

	@Override
	@Transactional
	public void remove(Slide slide) {
		this.slideDao.remove(slide);
	}

}
